package com.elbis.access.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {

	private static final String datePattern = new String("dd-MM-YYYY");

	private static final String dateTimePattern = new String(
			"dd-MM-YYYY'T'HH:mm:ss");

	private static final SimpleDateFormat dateFormat = new SimpleDateFormat(
			datePattern);

	private static final SimpleDateFormat dateTimeFormat = new SimpleDateFormat(
			dateTimePattern);

	public static String formatDate(Date date) {
		if (date != null) {
			return dateFormat.format(date);
		}
		return null;
	}

	public static String formatDateTime(Date date) {
		if (date != null) {
			return dateTimeFormat.format(date);
		}
		return null;
	}
}
